<?php

    include('./library/conn.php');

    $username = $_REQUEST['username'];
    $password = $_REQUEST['password'];
    $phone = $_REQUEST['phone'];
    

    $sql2 = "insert into users (username,password,phone) values ('$username','$password','$phone')";
    
    $insert = $conn->query($sql2); // 执行插入操作时返回一个布尔值 表示是否插入成功

    $conn -> close(); // 断开数据库连接

    if($insert){
        echo '{"msg":"注册成功","success":1}';
       
    }else{
         echo '{"msg":"注册失败","success":0}';
    }
?>